package cn.icare.cms.feignclients;

///rest/upload/image

import cn.icare.cms.config.FeignMultipartSupportConfig;
import cn.icare.cms.model.vo.rest.RespMsgVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(value = "microservice-app", configuration = FeignMultipartSupportConfig.class)
@Service
public interface UploadClient {

    //上传图片接口
    @PostMapping(value = "/rest/upload/image", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    ResponseEntity<RespMsgVO> uploadImage(@RequestPart("file") MultipartFile file
            , @RequestParam("kind") final String kindName);


    //获取所有区域列表
    @GetMapping("/rest/upload/getShareItemPic")
    ResponseEntity<RespMsgVO> getShareItemPic(@RequestParam("picUrl") final String name
            , @RequestParam(name = "orignPrice", required = false) final String orignPrice, @RequestParam("newPrice") final String newPrice);

}
